﻿    <div id="sidebar">
        <ul>
            <!-- Searchbar -->
            <li>
                <div id="search" >
                    @using (Html.BeginForm())
                    {
                        @Html.TextBox("searchstring") <button type="submit">Zoeken</button>
                    }
                </div> <!-- Einde searchbar -->
            </li>

            <li>
                @if (Request.IsAuthenticated) {
                    <text>
                        <h2>Welkom @User.Identity.Name</h2>
                        <ul>
                            <li>
                                @Html.ActionLink("Wijzig Wachtwoord", "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })
                            </li>
                            <li>
                                @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
                                    @Html.AntiForgeryToken()
                                
                                        <a href="javascript:document.getElementById('logoutForm').submit()">Uitloggen</a>
                                }
                            </li>
                        </ul>
                    </text>
                } else {
                    <ul>
                        <li>@Html.ActionLink("Registreer", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
                        <li>@Html.ActionLink("Inloggen", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
                    </ul>
                }
            </li>
            @if( User.Identity.IsAuthenticated ) //Ingelogd
            {
                <li>
                    <h2>mijn veilingen</h2>
                    <ul>
                        <li><a href="@Url.Action("OwnAuctions", "Home")">Eigen Veilingen</a></li>
                        <li><a href="@Url.Action("WinningAuctions", "Home")">Winnende Veilingen</a></li>
                        <li><a href="@Url.Action("WonAuctions", "Home")">Gewonnen Veilingen</a></li>
                    </ul>
                </li>
            }
        </ul>
    </div> <!-- einde #sidebar (info gebruikersnaam, zoekvelden, ...) -->
<div style="clear: both;"></div>